package com.regent.central.bill.repository;

import com.regent.central.bill.core.Delivery;
import com.regent.central.bill.dto.delivery.DeliveryDetailDTO;
import com.regent.central.bill.dto.delivery.DeliveryOrderDTO;
import com.regent.central.bill.dto.delivery.DeliveryRecordDTO;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface DeliveryMapper extends Mapper<Delivery> {
    /**
     * 获取发货动作列表
     * @param unitId
     * @param keyword
     * @param empIds
     * @param startSearchTime
     * @param startTime
     * @param endTime
     * @return
     */
    List<DeliveryOrderDTO> getDeliveryOrder(@Param("unitId") String unitId,
                                            @Param("keyword") String keyword,
                                            @Param("empIds") List<String> empIds,
                                            @Param("startSearchTime") String startSearchTime,
                                            @Param("startTime") String startTime,
                                            @Param("endTime") String endTime
                                          );

    /**
     * 发货单详情
     * @param deliveryOrderId
     * @return
     */
    DeliveryDetailDTO getDeliveryOrderDetail(@Param("deliveryOrderId")String deliveryOrderId);

    /**
     * 发货单操作记录
     * @param deliveryOrderId
     * @return
     */
    List<DeliveryRecordDTO> getDeliveryOrderRecord(@Param("deliveryOrderId")String deliveryOrderId);

    /**
     * 获取该日期最大单号
     * @param unitId
     * @param deliveryDay
     * @return
     */
    Integer getMaxDeliveryNoByDate(@Param("unitId")String unitId,
                                   @Param("deliveryDay") String deliveryDay);

    /**
     * 作废发货单
     * @param deliveryOrderId
     * @param userId
     */
    void canceledDeliveryOrder(@Param("deliveryOrderId")String deliveryOrderId,
                               @Param("userId")String userId);

}